import { http } from "@/utils/http";

type ResultTable = {
  [x: string]: any;
  total?: number;
  data?: Array<any>;
};

//查询抄表组列表
export const queryAmrList = (data?: Record<string, any>) => {
  return http.request<ResultTable>("post", `/sharing/api/v1/meterReadingGroup/queryListPage`, {
    data
  });
};

//删除抄表组
export const deleteAmrList = (data?: Record<string, any>) => {
  return http.request("post", `/sharing/api/v1/meterReadingGroup/delMeterReadingGroup`, {
    data
  });
};

//新增抄表组
export const addAmrList = (data?: Record<string, any>) => {
  return http.request("post", `/sharing/api/v1/meterReadingGroup/saveMeterReadingGroup`, {
    data
  });
};

//更新抄表组
export const updateAmrList = (data?: Record<string, any>) => {
  return http.request("post", `/sharing/api/v1/meterReadingGroup/updateMeterReadingGroup`, {
    data
  });
};

//抄表组详情
export const detailAmrList = (data?: Record<string, any>) => {
  return http.request("post", `/sharing/api/v1/meterReadingGroup/getMeterReadingGroup`, {
    data
  });
};

//查询抄表项
export const queryAmrItemList = (data?: Record<string, any>) => {
  return http.request<ResultTable>("post", `/sharing/api/v1/meterReadingItem/getMeterReadingItem`, {
    data
  });
};

//新增抄表项目
export const addAmrItemList = (data?: Record<string, any>) => {
  return http.request("post", `/sharing/api/v1/meterReadingItem/saveMeterReadingItem`, {
    data
  });
};

//更新抄表项目
export const updateAmrItemList = (data?: Record<string, any>) => {
  return http.request("post", `/sharing/api/v1/meterReadingItem/updateMeterReadingItem`, {
    data
  });
};

//删除抄表项目
export const deleteAmrItemList = (data?: Record<string, any>) => {
  return http.request("post", `/sharing/api/v1/meterReadingItem/delMeterReadingItem`, {
    data
  });
};
